// 根据角色动态生成路由
import { defineFakeRoute } from "vite-plugin-fake-server/client";

export default defineFakeRoute([
  {
    url: "/operator/login",
    method: "post",
    response: ({ body }) => {
      if (body.username === "admin") {
        return {
          code: 0,
          data: "eyJhbGciOiJIUzUxMiJ9.common"
        };
      } else {
        return {
          code: 0,
          data: "eyJhbGciOiJIUzUxMiJ9.common"
        };
      }
    }
  },
  {
    url: "/operator/info",
    method: "get",
    response: () => {
      return {
        code: 0,
        message: "ok",
        data: {
          operatorUuid: "6448f693e24dd8622684cf1e",
          companyUuid: "611cd2cc35a21e75f83fe948",
          loginName: "18311099999",
          accountNonLocked: true,
          realName: "wl",
          mobile: "18311099999",
          email: "1@1.com",
          type: 6,
          loginTimes: 1910,
          remark: "",
          companyName: "天机不测1",
          isCompanyAdmin: false,
          backgroundColor: null,
          position: "",
          companyShortName: "中国联通",
          roleKeyList: ["r_eva_admin", "r_eva", "r_meet", "r_ent_admin"],
          jobUuid: null,
          isOnline: null
        }
      };
    }
  }
]);
